package app.maker.entity;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Date;


/**
 * The persistent class for the sortie database table.
 * 
 */
@Entity
@Table(name="sortie")
@NamedQuery(name="Sortie.findAll", query="SELECT s FROM Sortie s")
public class Sortie implements Serializable {
	private static final long serialVersionUID = 1L;
	private int id;
	private Date date;
	private float quantite;
	private String type;
	private Produit produit;
	private User user;

	public Sortie() {
	}


	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(unique=true, nullable=false)
	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}


	@Temporal(TemporalType.DATE)
	@Column(nullable=false)
	public Date getDate() {
		return this.date;
	}

	public void setDate(Date date) {
		this.date = date;
	}


	@Column(nullable=false)
	public float getQuantite() {
		return this.quantite;
	}

	public void setQuantite(float quantite) {
		this.quantite = quantite;
	}


	@Column(nullable=false, length=45)
	public String getType() {
		return this.type;
	}

	public void setType(String type) {
		this.type = type;
	}


	//bi-directional many-to-one association to Produit
	@ManyToOne
	@JoinColumn(name="idProduit", nullable=false)
	public Produit getProduit() {
		return this.produit;
	}

	public void setProduit(Produit produit) {
		this.produit = produit;
	}


	//bi-directional many-to-one association to User
	@ManyToOne
	@JoinColumn(name="userID", nullable=false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}